d/tests/build: Use correct compiler for proposed autopkgtest cross-architecture testi...
authorSimon McVittie <smcv@debian.org>
Sat, 14 Dec 2019 11:26:33 +0000 (11:26 +0000)
committerSimon McVittie <smcv@debian.org>
Sat, 14 Dec 2019 11:26:33 +0000 (11:26 +0000)
debian/changelog
debian/tests/build

index 23a7b5a2091c5dfd9bef0ef91d30bb29fea3de02..4d0c60e6d3a7e6c121e0e663f68ec9f6b53b73aa 100644 (file)
@@ -2,6 +2,8 @@ ostree (2019.6-1) UNRELEASED; urgency=medium
 
   * New upstream release
     - d/libostree-1-1.symbols: Update
+  * d/tests/build: Use correct compiler for proposed autopkgtest
+    cross-architecture testing support
 
  -- Simon McVittie <smcv@debian.org>  Sat, 14 Dec 2019 10:52:40 +0000
 
index f10f8cf48154149520416899ed299f0f58a16dd3..1a40303e28c8a5b34b38a48e864510bdaa34d9fa 100755 (executable)
@@ -6,6 +6,12 @@ set -x
 
 cd "$AUTOPKGTEST_TMP"
 
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
+else
+    CROSS_COMPILE=
+fi
+
 cat > trivial.c <<EOF
 #include <ostree.h>
 
@@ -16,7 +22,9 @@ int main (void)
 }
 EOF
 
-gcc -o trivial trivial.c $(pkg-config --cflags --libs ostree-1 gobject-2.0)
+# Deliberately word-splitting, that's how pkg-config works:
+# shellcheck disable=SC2046
+"${CROSS_COMPILE}gcc" -o trivial trivial.c $("${CROSS_COMPILE}pkg-config" --cflags --libs ostree-1 gobject-2.0)
 test -x trivial
 ./trivial
-echo "ok 3 run it"
+echo "OK"